Add Memory
Store plain text documents or memories in Hyperspell to connect AI applications with unstructured and semi-structured data sources.
Instructions
Add a plain text document or memory to Hyperspell.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| title | No |
Implementation Reference
- src/hyperspell_mcp/server.py:145-150 (handler)The handler function that implements the 'Add Memory' tool logic by adding a plain text document to Hyperspell via the API and returning the status.def add_memory(text: str, title: str | None = None) -> DocumentStatus: """Add a plain text document or memory to Hyperspell.""" r = mcp.api.documents.add( text=text, collection=mcp.config.collection, title=title, source="mcp" ) return DocumentStatus.from_pydantic(r)
- src/hyperspell_mcp/server.py:141-144 (registration)Registers the add_memory function as the MCP tool named 'Add Memory' using the @mcp.tool decorator.@mcp.tool( name="Add Memory", description="Add a plain text document or memory to Hyperspell.", )
- src/hyperspell_mcp/types.py:46-50 (schema)Dataclass model defining the output schema for the 'Add Memory' tool (DocumentStatus).class DocumentStatus(BaseModel): id: int status: str collection: str